package com.example.communist_app_api.service.impl;

import com.example.communist_app_api.db.dao.UserCommentLikeDao;
import com.example.communist_app_api.db.pojoDto.UserCommentLike;
import com.example.communist_app_api.service.UserCommentLikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class UserCommentLikeServiceImpl implements UserCommentLikeService {

    @Autowired
    private UserCommentLikeDao userCommentLikeDao;

    @Override
    public List<UserCommentLike> getUserCommentLike(Integer userId) {
        return userCommentLikeDao.getUserCommentLike(userId);
    }

    @Override
    public int insertUserCommentLike(Integer userId, Integer id) {
        int insertNum = userCommentLikeDao.insertUserCommentLike(userId, id);
        return insertNum;
    }

    @Override
    public int deleteUserCommentLike(Integer userId,Integer id) {
        int deleteNum = userCommentLikeDao.deleteUserCommentLike(userId,id);
        return deleteNum;
    }


    @Override
    public Boolean judgmentLike(Integer userId,Integer id) {
        Boolean i = userCommentLikeDao.judgmentLike(userId,id);
        return i;
    }

    @Override
    public int getLikeNum(Integer id) {
        return userCommentLikeDao.getLikeNum(id);
    }
}
